#include<iostream>
#include<string>
#include<vector>
using namespace std;

//int main()
//{
//	string key = "olikuj";
//	for (auto ch : key)
//	{
//		cout << ch << endl;
//	}
//
//	return 0;
//}



//int main()
//{
//	int N;
//	cin >> N;
//	vector<int> v;
//	for (int i = 1; i <= N / i; i++)
//		if (N % i == 0)
//		{
//			v.push_back(i);
//			if (i != N / i)
//			{
//				v.push_back(N / i);
//			}
//
//		}
//	for (int i = 0; i < v.size(); ++i)
//	{
//		cout << v[i] << " ";
//	}
//}

//int main()
//{
//	vector<vector<int>> a(3, vector<int>(3));
//	vector<int> arr(3);
//	for (int i = 0; i < 2; i++)
//	{
//		cin >> arr[i];
//	}
//	return 0;
//}
#include<algorithm>
int main()
{
    int n = 0;
    int i = 0, j = 1;
    cin >> n;
    if (n == 0)
        return 0;
    vector<vector<int>> mul((n * (n - 1)) / 2 + 1, vector<int>((n * (n - 1)) / 2 + 1));
    vector<vector<int>> add((n * (n - 1)) / 2 + 1, vector<int>((n * (n - 1)) / 2 + 1));
    for (int i = 0; i < (n * (n - 1)) / 2; i++)
    {
        mul[i][0] = 1;
        add[i][0] = 0;
    }
    vector<int> tmp(n);
    for (i = 0; i < n; ++i)
    {
        cin >> tmp[i];
    }
    sort(tmp.begin(), tmp.end());

    //for (i = 0; i < tmp.size(); ++i)
    //{
    //    cout << tmp[i] << " ";
    //}


    int index = 0, cur = 1;
    int pos = 1;
    int cnt = 0;
    i = 0, j = 1;
    bool flag = true;
    while (index < tmp.size() - 1)
    {
        while (cur < tmp.size())
        {
            if (j != 1)
            {
                mul[i][j] = mul[i][j - 1] * tmp[cur];
                add[i][j] = add[i][j - 1] + tmp[cur];

            }
            else
            {
                mul[i][j] = tmp[index] * tmp[cur];
                add[i][j] = tmp[index] + tmp[cur];
            }

            cur++;
            j++;
        }
        i++;
        j = 1;
        if (pos < tmp.size() - 1 && tmp[index] != tmp[index + 1])
        {
            cur = pos + 1;
        }
        else
        {
            int t = index + 1;
            while (t < tmp.size())
            {
                if (tmp[t] != tmp[index])
                {
                    index = t;;
                    break;
                }
                else
                {
                    flag = false;
                }
                t++;
            }

            cur = index + 1;
        }
        if (!flag)
        {
            break;
        }
        pos = cur;

    }


    for (i = 0; i < mul.size(); ++i)
    {
        for (j = 1; j < mul[0].size(); ++j)
        {
            if (mul[i][j] < add[i][j])
            {
                cnt++;
            }
            /* cout << mul[i][j] << " ";*/
        }
    }

    cout << cnt << endl;
    return 0;
}



//#include <iostream>
//#include <string>
//#include <vector>
//#include <map>
//using namespace std;
//////
//////class K
//////{
//////public:
//////	void print()
//////	{
//////		cout << "print()" << endl;
//////	}
//////};
//////
//////class s : private K
//////{
//////
//////};
//////
//////int main()
//////{
//////	s a;
//////	a.print();
//////	return 0;
//////}
////
//////int main()
//////{
//////	string str;
//////	getline(cin, str);
//////	vector<string> vs;
//////	int cnt = 0;
//////	int index = 0;
//////
//////	
//////	while (index < str.size())
//////	{
//////		string tmp;
//////		if (str[index] == '"')
//////		{
//////			int i = index+1;
//////			while (str[i] != '"'&& i < str.size())
//////			{
//////				tmp += str[i];
//////				i++;
//////			}
//////			vs.push_back(tmp);
//////			cnt++;
//////			index = i + 2;
//////		}
//////		else
//////		{
//////			int i = index;
//////			while (str[i] != ' ' && i<str.size())
//////			{
//////				tmp += str[i];
//////				i++;
//////			}
//////			vs.push_back(tmp);
//////			cnt++;
//////			index = i + 1;
//////		}
//////	}
//////	cout << cnt << endl;
//////	for (auto& e : vs)
//////	{
//////		cout << e << endl;
//////	}
//////	
//////	return 0;
//////}
////#include <algorithm>
////bool flag = true;
////int cnt = 0;
////vector<int> result;
////
////
////bool dfs(int N, int M)
////{
////	if (N == M)
////	{
////		result.push_back(cnt);
////		return true;
////	}
////
////	if (N > M)
////	{
////		return false;
////	}
////	vector<int> v;
////	for (int i = 1; i <= N / i; i++)
////	{
////		if (N % i == 0)
////		{
////			v.push_back(i);
////			if (i != N / i)
////			{
////				v.push_back(N / i);
////			}
////		}
////	}
////
////	for (int i = 1; i < v.size()-1; ++i)
////	{
////		if (v[i] != 1 || v[i] != N)
////		{
////			cnt++;
////			dfs(N + v[i], M);
////			cnt--;
////		}
////	}
////
////	return true;
////
////}
////int main()
////{
////	int N, M;
////	cin >> N >> M;
////	dfs(N, M);
////	int min = 10000;
////
////	for (int i = 0; i < result.size(); ++i)
////	{
////		if (result[i] < min)
////		{
////			min = result[i];
////		}
////	}
////	cout << min << endl;
////
////	return 0;
////}
////
////
//////#include <iostream>
//////#include <string>
//////#include <vector>
//////using namespace std;
//////
//////int cnt = 0;
//////vector<int> result;
//////void dfs(int& N, int& M)
//////{
//////	if (N == M)
//////	{
//////		result.push_back(cnt);
//////		return;
//////	}
//////
//////	if (N > M)
//////	{
//////		return;
//////	}
//////	vector<int> v;
//////	for (int i = 2; i < N; i++)
//////	{
//////		if (N % i == 0)
//////		{
//////			v.push_back(i);
//////		}
//////	}
//////
//////	for (int i = 0; i < v.size(); ++i)
//////	{
//////		cnt++;
//////		dfs(N += v[i], M);
//////		N -= v[i];
//////		cnt--;
//////	}
//////
//////}
//////int main()
//////{
//////	int N, M;
//////	cin >> N >> M;
//////	dfs(N, M);
//////	int min = 10000;
//////
//////	for (int i = 0; i < result.size(); ++i)
//////	{
//////		if (result[i] < min)
//////		{
//////			min = result[i];
//////		}
//////		//cout << result[i] << endl;
//////	}
//////
//////	cout << min << endl;
//////
//////	return 0;
//////}
//
//class A
//{
//public:
//	A(const char* s) { cout << s << endl; } ~A() {}
//
//};
//
//class B :virtual public A
//{
//public:
//	B(const char* s1, const char* s2) :A(s1) { cout << s2 << endl; }
//};
//
//class C :virtual public A {
//public:
//	C(const char* s1, const char* s2) :A(s1) { cout << s2 << endl; }
//};
//
//class D :public B, public C
//{
//public:
//	D(const char* s1, const char* s2, const char* s3, const char* s4) :B(s1,s2),C(s1,s3),A(s1)
//	{ cout << s4 << endl; }
//};
//
//int main()
//{
//	D* p = new D("class A", "class B", "class C", "class D");
//	delete p;
//	return 0;
//}